package wqh.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wqh.dao.XkDeviceDao;
import wqh.domain.XkDevice;
import wqh.service.XkDeviceService;

import java.util.List;

/**
 * Created by devts on 2017/1/5.
 */
@Service("xkDeviceService")
public class XkDeviceServiceImpl implements XkDeviceService {

    private final XkDeviceDao dao;

    @Autowired
    public XkDeviceServiceImpl(XkDeviceDao xkDeviceDao){
        this.dao = xkDeviceDao;
    }

    public void save(XkDevice entity) {
        this.dao.save(entity);
    }

    public void update(XkDevice entity) {
        this.dao.update(entity);
    }

    public void delete(XkDevice entity) {
        this.dao.delete(entity);
    }

    public void deleteAll() {
        this.dao.deleteAll();
    }

    public List<XkDevice> findAll() {
        return this.dao.findAll();
    }

    public XkDevice findById(Long id) {
        return this.dao.findById(id);
    }

    public XkDevice findByDeviceID(Long device_id) {
        return this.dao.findByDeviceID(device_id);
    }

    public void updateIpByDeviceID(Long device_id, String ip) {
        this.dao.updateIpByDeviceID(device_id, ip);
    }
}
